package com.neusoft.resturant.service.impl;

import com.neusoft.resturant.entity.Student;
import com.neusoft.resturant.mapper.StudentMapper;
import com.neusoft.resturant.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学生Service业务层处理
 * 
 * @author Daniel
 * @date 2023-09-27
 */
@Service
public class StudentServiceImpl implements IStudentService
{
    @Autowired
    private StudentMapper studentMapper;

    /**
     * 查询学生
     * 
     * @param id 学生主键
     * @return 学生
     */
    @Override
    public Student selectStudentById(Long id)
    {
        return studentMapper.selectStudentById(id);
    }

    /**
     * 查询学生列表
     * 
     * @param Student 学生
     * @return 学生
     */
    @Override
    public List<Student> selectStudentList(Student Student)
    {
        return studentMapper.selectStudentList(Student);
    }

    /**
     * 新增学生
     * 
     * @param Student 学生
     * @return 结果
     */
    @Override
    public int insertStudent(Student Student)
    {
        return studentMapper.insertStudent(Student);
    }

    /**
     * 修改学生
     * 
     * @param Student 学生
     * @return 结果
     */
    @Override
    public int updateStudent(Student Student)
    {
        return studentMapper.updateStudent(Student);
    }


    /**
     * 删除学生信息
     * 
     * @param id 学生主键
     * @return 结果
     */
    @Override
    public int deleteStudentById(Long id)
    {
        return studentMapper.deleteStudentById(id);
    }
}
